package p_2023_03_11_Static;

import java.util.ArrayList;

public class StudentUtil {

    private StudentUtil() {

    }

    //方法
    public static int getMaxAge(ArrayList<Student> list){
        int maxAge = list.get(0).getAge();
        for (int i = 1; i < list.size(); i++) {
            int age = list.get(i).getAge();
            if(age > maxAge){
                maxAge = age;
            }
        }
        return maxAge;
    }



}
